import request from '@/utils/request'

export default {
  // 告警列表
  alertList(data) {
    const url = 'alert/equipmentCollectAlert/list'
    return request.get(url, data)
  },
  // 网格隔离列表
  getGridIsolationList(data) {
    const url = 'alert/gridIsolation/list'
    return request.get(url, data)
  },
  // 新增网格隔离
  addGridIsolation(data) {
    const url = 'alert/gridIsolation'
    return request.postJson(url, data)
  },
  //删除网格隔离
  deleteGridIsolation(data) {
    const url = 'alert/gridIsolation'
    return request.delete(url, data)
  },
  // 修改网格隔离
  updateGridIsolation(data) {
    const url = 'alert/gridIsolation'
    return request.putJson(url, data)
  },
  //网格隔离详情
  getGridIsolationDetail(data) {
    const url = 'alert/gridIsolation/model'
    return request.get(url, data)
  },
  //设备隔离列表
  getDeviceIsolationList(data) {
    const url = 'alert/equipmentIsolation/list'
    return request.get(url, data)
  },
  // 新增设备隔离
  addDeviceIsolation(data) {
    const url = 'alert/equipmentIsolation'
    return request.postJson(url, data)
  },
  // 删除设备隔离
  deleteDeviceIsolation(data) {
    const url = 'alert/equipmentIsolation'
    return request.delete(url, data)
  },
  //修改设备隔离
  updateDeviceIsolation(data) {
    const url = 'alert/equipmentIsolation'
    return request.putJson(url, data)
  },
  //设备隔离详情
  getDeviceIsolationDetail(data) {
    const url = 'alert/equipmentIsolation/model'
    return request.get(url, data)
  },
  // 告警隔离列表
  warnIsolationList(data) {
    const url = 'alert/alertEquipmentCollectIsolation/list'
    return request.get(url, data)
  },
  // 告警隔离详情
  getWarnIsolationDetail(data) {
    const url = 'alert/alertEquipmentCollectIsolation/model'
    return request.get(url, data)
  },
  // 消除告警隔离
  deleteWarnIsolation(id, data) {
    const url = "alert/alertEquipmentCollectIsolation/batchEliminateByIds/" + id
    return request.post(url, data)
  },
  // 网格列表
  getGridTree() {
    const url = 'main/grid/tree'
    return request.get(url)
  },
  // 部门列表
  getDeptTree() {
    const url = 'system/dept'
    return request.get(url)
  },
  //无线设备列表
  getWifiDeviceList(data) {
    const url = 'main/equipment/list'
    return request.get(url,data)
  },
  // 设备类型字典列表
  getdeviceTypeList() {
    const url = 'system/dict/getDictValueAttr?fieldName=collect_type&tableName=t_equipment_collect&'
    return request.get(url)
  },
  // 操作人员列表
  getOperatorList() {
    const url = 'system/user/normal'
    return request.get(url)
  },
  // 消警原因列表
  getEliminateReasonList() {
    const url = 'system/dict/getDictValueAttr?fieldName=alarm_actual_desc_2&tableName=t_job_reply&'
    return request.get(url)
  },
  getEquipmentCollectAlertList(data) {
    const url = 'alert/equipmentCollectAlert/list'
    return request.get(url,data)
  },
  confirmAlertTime(data) {
    const url = 'alert/equipmentCollectAlert/confirmAlertTime'
    return request.get(url,data)
  },
  jobDistribute(data) {
    const url ='console/api/v1/alarm-job/job-distribute'
    return request.postBody(url,data)
  },

  createAndDistribute(data) {
    const url ='console/api/v1/alarm-job/createAndDistribute'
    return request.post(url,data)
  } ,

  create(data) {
    const url ='console/api/v1/alarm-job/create'
    return request.postBody(url,data)
  } ,

  batchEliminateByIds(data) {
    const url ='alert/equipmentCollectAlert/batchEliminateByIds'+'/'+data.ids
    return request.post(url,data)
  },
  //
  getByEquipmentId(data) {
    const url ='console/equipmentMonitorSettings/getByEquipmentId'
    return request.get(url,data)
  }
}
